package cn.yx.common.log.service;

import cn.yx.sys.remote.dto.SysLogRemoteDto;
import cn.yx.sys.remote.service.SysLogRemoteService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * <p>系统日志服务类，异步调用系统日志远程服务接口</p>
 *
 * @author Wgssmart
 */
@Component
@Slf4j
public class SysLogService {

    /**
     * 系统日志微服务，不检测是否已注册该服务
     */
    @DubboReference(check = false)
    private SysLogRemoteService sysLogRemoteService;

    @Async
    public void saveAsync(SysLogRemoteDto sysLogRemoteDto) {
        log.info("save sys log async");
        sysLogRemoteService.save(sysLogRemoteDto);
    }

}
